//
//  ViewController.m
//  tableview review 20151119
//
//  Created by blue on 15-11-19.
//  Copyright (c) 2015年 sxh. All rights reserved.
//

#import "ViewController.h"
#import "InputTableViewController.h"

@interface ViewController () <UITableViewDataSource,UITableViewDelegate>

@property(strong,nonatomic) UITableView *tableview;

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    self.tableview = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
    self.tableview.dataSource = self;
    self.tableview.delegate = self;
    [self.view addSubview:self.tableview];
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 3;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
    
    cell.textLabel.text = @"吴刘梧";
    cell.detailTextLabel.text = @"15200411916";
    cell.imageView.image = [UIImage imageNamed:@"ss.jpg"];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
    

}


-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    InputTableViewController *con = [[InputTableViewController alloc] initWithStyle:UITableViewStyleGrouped];
    UITableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath];
    con.tel = cell.detailTextLabel.text;
    [self.navigationController pushViewController:con animated:YES];
    
    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
